<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateCmcOrderShippingFeesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('cmc_order_shipping_fees', function (Blueprint $table) {
            $table->increments('shipping_fee_id');
            $table->integer('is_default')->comment('是否是默认模板');
            $table->integer('co_id')->comment('物流公司ID');
            $table->integer('shop_id')->comment('店铺ID');
            $table->text('province_id_array')->comment('省ID组');
            $table->text('city_id_array')->comment('市ID组');
            $table->integer('weight_is_use')->comment('是否启用重量运费');
            $table->decimal('weight_snum')->comment('首重');
            $table->decimal('weight_sprice')->comment('首重运费');
            $table->decimal('weight_xnum')->comment('续重');
            $table->decimal('weight_xprice')->comment('续重运费');
            $table->integer('volume_is_use')->comment('是否启用体积计算运费');
            $table->decimal('volume_snum')->comment('首体积量');
            $table->decimal('volume_sprice')->comment('首体积运费');
            $table->decimal('volume_xnum')->comment('续体积量');
            $table->decimal('volume_xprice')->comment('续体积运费');
            $table->integer('bynum_is_use')->comment('是否启用计件方式运费');
            $table->integer('bynum_snum')->comment('首件');
            $table->decimal('bynum_sprice')->comment('首件运费');
            $table->integer('bynum_xnum')->comment('续件');
            $table->decimal('bynum_xprice')->comment('续件运费');
            $table->dateTime('create_time')->comment('创建日期');
            $table->dateTime('update_time')->comment('最后更新时间');
            $table->text('district_id_array')->comment('区县ID组');
            $table->timestamps();
            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('cmc_order_shipping_fees');
    }
}
